<?php
 $fenetre = 1 ;
 If (!IsSet ($reentrance))
  {
   Session_Start () ;
   Include ("../../include/garennes.cfg") ;
   Include ("../../include/init.php") ;
   Include ("../include/config.inc") ;
   verif_droits ($droit_courant, $_SESSION ["code"]) ;
  }
 
 $action = var_courante ("action", 0, 1) ;
 $menu = var_courante ("menu", 0, 500) ;
 $periode = var_courante ("periode", 0, 0) ;
 $c = var_courante ("c", 0, 0) ;
 $action = var_courante ("action", 0, 0) ;
 $code = var_courante ("code", 0, $_SESSION ["code"]) ;
 $id_classe = var_courante ("id_classe", 0, 0) ;
 $discipline = var_courante ("discipline", 0, 0) ;
 $id_service_prof = var_courante ("id_service_prof", 0, 0) ;
 $id_service_classe = var_courante ("id_service_classe", 0, 0) ;
 $millesime = millesime (0) ;
 
 $param_theme = parametres_theme (themeparsession ($_SESSION ["code"])) ;
 $rep_themes = "../../images/themes/" ;
 Include ($rep_themes.$param_theme ["nom_repertoire"]."/".$param_theme ["fichier_config"]) ;

 $resultat_controle = SQL_commande ("SELECT * FROM controles WHERE id_controle='".$c."' LIMIT 1", $id_sql) ;
 $controle = SQL_tableau_associatif ($resultat_controle, "") ;
 
 Switch ($action)
  {
   Case 1 : $resultats = SQL_commande ("SELECT * FROM menus WHERE numero='$droit_courant' AND ordre='0'", $id_sql) ;
            $l = SQL_tableau_associatif ($resultats, "") ; 
            Echo "<HTML><HEAD>" ;
            entete_html ("Garennes", "", 1) ;
            Echo styles ("none", "none", "none", $theme [0][32], "none") ;
            Echo "</HEAD>" ;
            Echo "<BODY BACKGROUND=\"".$rep_themes.$param_theme ["nom_repertoire"]."/".$theme [9][10]."\" TEXT=\"".$ligne ["couleur_texte"]."\" onContextMenu=\"return false\">\n" ;
	    Echo "<CENTER><IMG SRC=\"../../images/logo.png\" BORDER=\"0\">" ;
	    Echo "<HR>Voulez-vous supprimer la colonne de notes du <B>" ;
	    Echo decode_date_2 ($controle ["date"])."</B> de coefficient ".Str_Replace (".", ",", $controle ["coefficient"])." ?" ;
	    Echo "<HR><A HREF=\"javascript:window.close()\">&nbsp;NE&nbsp;PAS&nbsp;SUPPRIMER&nbsp;:&nbsp;ANNULER&nbsp;</A><HR>" ;
	    Echo "<A HREF=\"./efface_colonne.php?menu=500&periode=".$periode."&c=".$c."&action=2&code=".$_SESSION ["code"]."&id_classe=".$id_classe."&discipline=".$discipline ;
	    Echo "&id_service_prof=".$id_service_prof."&id_service_classe=".$id_service_classe."\">&nbsp;CONFIRMER&nbsp;LA&nbsp;SUPPRESSION&nbsp;</A>" ;
	    Echo "</CENTER>" ;
	    Echo "</BODY></HTML>" ;
            Break ;
   Case 2 : $resultat = SQL_commande ("DELETE FROM notes WHERE controle='".$c."' AND millesime='".$millesime."'", $id_sql) ;
            $resultat = SQL_commande ("DELETE FROM controles WHERE id_controle='".$c."' LIMIT 1", $id_sql) ;
	    $resultat = SQL_commande ("UPDATE calcul_moyenne SET ok='0' WHERE classe='".$id_classe."' AND periode='".periode_valide ($id_classe)."'
					  AND service_prof='".$id_service_prof."' AND service_classe='".$id_service_classe."' AND millesime='".$millesime."' LIMIT 1", $id_sql) ;
            Echo "<HTML><HEAD><SCRIPT> window.open(\"./saisie_notes.php?menu=200&periode=".$periode."&code=".$_SESSION ["code"]."&id_classe=".$id_classe."&discipline=".$discipline."&id_service_prof=".$id_service_prof."\",\"" ;
	    If ($droit_courant == $droit_prof) { Echo "travail_affichage" ; } Else { Echo "travail_affichage_3" ; }
	    Echo "\",\"\") ; window.close() </SCRIPT></HEAD></HTML>" ;
            Break ;
  }
?>